const path = require('path')
const fs = require("fs");
const nodeModules = {};
fs.readdirSync("node_modules")
    .filter(function(x) {
        return [".bin"].indexOf(x) === -1;
    })
    .forEach(function(mod) {
        nodeModules[mod] = "commonjs " + mod;
    });

module.exports = {
    entry: './main.js',
    output: {
        path: path.resolve() + "",
        filename: "bundle.js",
    },
    node: {
        fs: 'empty',
        child_process: 'empty',
        tls: 'empty',
        net: 'empty'
    },
    target: "node",
    externals: nodeModules,
};